﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="EditPower.aspx.cs" Inherits="Admin_EditPower" %>

<%@ Register Src="adminfoot.ascx" TagName="adminfoot" TagPrefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
        <link rel="stylesheet" href="imgs/admin.css" type="text/css" media="all" />
    <script type="text/javascript" src="../DotNet_net/js/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="../DotNet_net/js/jquery.form.js"></script>
</head>
<body onload="$('#loading').hide()">
<form name="addform" id="addformAjax"  method="post">
<div id="loading" style="display:block">   
    <div class="loading-indicator">   
        页面正在加载中...   
    </div>   
</div>  
<ul id="makeHtmlTab2">
<li class="hover"><a href="javascript:void(0)" onclick="">添加权限</a></li>
</ul>
    <table class="tb" id="addRole">
    <tr class="thead"><th colspan="8">
        添加角色</th></tr>	
        <tr align="center">
            <td style="width: 152px" align="right" >
                权限名称：(powerName)</td>
            <td style="width: 166px" align="left">
                <input id="powerName" style="width: 130px" type="text"  name="powerName" runat="server"/><span style="color: #ff0000">＊</span></td>
            <td align="center" style="width: 134px">
                </td>
            <td align="left" >
                <span style="color: #ff0000">
                    <input id="demoPage_hid" type="hidden" runat="server" />
                    <input id="pid_hid" runat="server" name="pid_hid" type="hidden" />
                    <input id="pageIndex_hid" type="hidden" runat="server" /></span></td>
    </tr>
    
    <tr align="center">
            <td align="right" style="height: 32px; width: 152px;" valign="top">
                所属模块:(demoName)</td>
            <td style="height: 32px; width: 166px;" align="left">
                <input id="demoName" type="text" name="demoName" runat="server"/><span style="color: #ff0000">＊</span></td>
                 <td align="center" style="width: 134px; height: 32px;">
                     模块名称：(demoInfo)</td>
            <td align="left" style="height: 32px" >
                <input id="demoInfo" type="text"  name="demoInfo" runat="server"/><span style="color: #ff0000">＊</span></td>
    </tr>
    <tr align="center">
            <td align="right" style="width: 152px;" valign="top">
                可操作页面：(powerPage)</td>
            <td  align="left" colspan="3" >
                <span style="color: #ff0000"></span><div style="height:400px; overflow: auto; "><span style="color: #ff0000;" >
                   <%=pageHtml(this.demoPage_hid.Value)%></span></div>
              
                </td>
    </tr>
        <tr align="center">
            <td align="center" colspan="6" style="height: 39px">
                
                <input id="tijiao" class="btn" type="button" value="保存修改" name="Submit" />&nbsp;&nbsp;
                <input id="btn_back" class="btn" type="button" onclick="javascript:location.href='adminPower.aspx'" value="返  回" /></td>
        </tr>
</table>
        <uc1:adminfoot ID="Adminfoot1" runat="server" />
        
    </form>
</body>
<script type="text/javascript">
$(document).ready(function(){
    var options = { 
        beforeSubmit:  showRequest,  // pre-submit callback 
        success:       showResponse,  // post-submit callback 
        // other available options: 
         url:       "?state=update&pid="+$("#pid_hid").attr("value")+"&CurrentIndex="+$("pageIndex_hid").attr("value"),         // override for form's 'action' attribute 
       // type:        'post'        // 'get' or 'post', override for form's 'method' attribute 
        //dataType:  null        // 'xml', 'script', or 'json' (expected server response type) 
        clearForm: false,        // clear all form fields after successful submit 
        resetForm: false        // reset the form after successful submit 
 
        // $.ajax options can be used here too, for example: 
        //timeout:   3000 
    }; 
    $('#tijiao').click(function(){
        if($("#powerName").attr("value")!=""&&$("#demoName").attr("value")!=""&&$("#demoInfo").attr("value")!="")
        {
            $("#loading").show();
            $('#addformAjax').ajaxSubmit(options);
            return false;
        }
        else
        {
            alert("请填写完整信息！");
            $("#loading").hide();
        }
    });
})
function showResponse(msg)
{ 
    if(msg=="1")
    {
        alert("修改成功!!!");   
        $("#loading").hide();
        location.href="adminPower.aspx?CurrentIndex="+$("#pageIndex_hid").attr("value");
    } 
    else
    {
        alert(msg);
        $("#loading").hide();
    }
}

function showRequest(formData, jqForm, options)
 { 		
    return true; 
} 

</script>
</html>
